import { Fragment, Node as ProsemirrorNode, NodeType } from '@tiptap/pm/model'

/**
 *
 * @param { NodeType } cellType
 * @param { Fragment | ProsemirrorNode | Array<ProsemirrorNode> } cellContent
 * @return {ProsemirrorNode | null | undefined}
 */
export function createCell(cellType,cellContent) {
  if (cellContent) {
    return cellType.createChecked(null, cellContent)
  }
  return cellType.createAndFill()
}
